<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS自定义对象复杂用法</title>
</head>
<body>
<script>

    let p = {
        name:"韦小宝",
        age:17,
        friends:["茅十八","小玄子"],
        teacher:[
            {
                name:"陈近南",
                age:30,
                kongfu:function(){
                    console.log("剑法")
                }
            },
            {
                name:"独臂神尼",
                age:40,
                kongfu:function (){
                    console.log("凌波微步")
                }
            },
            {
                name:"海大富",
                age:60,
                kongfu:function (){
                    console.log("化骨绵掌")
                }
            }
        ],

        wife:["阿珂","双儿","建宁","曾柔","沐剑屏","方怡","苏荃"]

    }

    /*
       我们更习惯用这种格式来保存数据，并在网络上传输，这种数据个数叫做JSON
     */

    console.log(p.name)
    p.teacher[1].kongfu()

</script>
</body>
</html>